project(DecompCSS)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:CXX,ARMClang,AppleClang,Clang,GNU,LCC>")
add_compile_options(-O3)
find_package(wxWidgets REQUIRED COMPONENTS net core base)
find_package(fmt REQUIRED)
find_package(lz4 REQUIRED)
include(${wxWidgets_USE_FILE})

file(GLOB SourceCode "./*.cpp")

add_executable(DecompCSS ${SourceCode})

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
  message("You are using debug profile.")
  target_compile_options(
    DecompCSS
    INTERFACE
      "$<${gcc_like_cxx}:$<BUILD_INTERFACE:-ggdb;-O0;-Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused>>"
  )
else()
  message("You are using release profile.")
  target_compile_options(
    DecompCSS INTERFACE "$<${gcc_like_cxx}:$<BUILD_INTERFACE:-O3;-Wall>>")
endif()

target_include_directories(DecompCSS PUBLIC "../../inc")
target_link_libraries(DecompCSS PUBLIC ${wxWidgets_LIBRARIES} fmt lz4)
